package net.sky.oa.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.BatchSize;

/**
 * 文档用户表
 * DocFileUser. @author hond
 */
@Entity
@Table(name = "DOC_FILE_USER")//文档用户表
@BatchSize(size=15)
public class DocFileUser implements Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields
	private Long id;
	private Date sendtime;    //发送、转发时间
	private Integer isrecieve;//签收状态  1为未签收  2为已签收
	private Date recievetime; //签收时间
	private Integer isforward;//是否转发,1为否 2为是
	private FileAttach file;   //文档id
	private SysEmployee susr;   //发送人
	private SysEmployee fusr;   //转发人
	private SysEmployee rusr;   //接收人

	// Constructors

	/** default constructor */
	public DocFileUser() {
	}

	/** minimal constructor */
	public DocFileUser(Long id) {
		this.id = id;
	}
	@Id 
	@SequenceGenerator(name="SQ_DOCFILEUSER_ID",sequenceName="SQ_DOCFILEUSER_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_DOCFILEUSER_ID")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "SENDTIME", length = 7)
	public Date getSendtime() {
		return this.sendtime;
	}

	public void setSendtime(Date sendtime) {
		this.sendtime = sendtime;
	}
	@Column(name = "ISRECIEVE", precision = 1, scale = 0)
	public Integer getIsrecieve() {
		return isrecieve;
	}

	public void setIsrecieve(Integer isrecieve) {
		this.isrecieve = isrecieve;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "RECIEVETIME", length = 7)
	public Date getRecievetime() {
		return this.recievetime;
	}

	public void setRecievetime(Date recievetime) {
		this.recievetime = recievetime;
	}

	@Column(name = "ISFORWARD", precision = 1, scale = 0)
	public Integer getIsforward() {
		return isforward;
	}

	public void setIsforward(Integer isforward) {
		this.isforward = isforward;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "FILE_ID")
	public FileAttach getFile() {
		return this.file;
	}

	public void setFile(FileAttach file) {
		this.file = file;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "SUSR_ID")
	public SysEmployee getSusr() {
		return this.susr;
	}

	public void setSusr(SysEmployee susr) {
		this.susr = susr;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "FUSR_ID")
	public SysEmployee getFusr() {
		return this.fusr;
	}

	public void setFusr(SysEmployee fusr) {
		this.fusr = fusr;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "RUSR_ID")
	public SysEmployee getRusr() {
		return this.rusr;
	}

	public void setRusr(SysEmployee rusr) {
		this.rusr = rusr;
	}

}